#include "app_message.h"
#include "log/log.h"

int main(int argc, char const *argv[])
{
    char *json_str = "{\"conn_type\":1,\"id\":\"5858\",\"msg\":\"61626364\"}";

    // json消息 =》 字符数组消息
    char message_chars[100];
    int chars_len = app_message_jsonToChars(json_str, message_chars, 100);
    log_debug("message_chars=%.*s, chars_len=%d", chars_len, message_chars, chars_len);

    // 字符数组消息 =》 json消息
    char *message_json = app_message_charsToJson(message_chars, chars_len);
    log_debug("message_json=%s", message_json);
    
    return 0;
}
